package code 
{
	/**
	 * ...
	 * @author XXL
	 */
	public class Random 
	{
		private var _seed:int;
		
		public function Random(seed:int) 
		{
			_seed = seed;
		}
		
		public function get seed():int 
		{
			return _seed;
		}
		
		public function set seed(value:int):void 
		{
			_seed = value;
		}
		
		public function nextInt(n:int = int.MAX_VALUE):int
		{
			return n > 0 ? nextNumber() * n : nextNumber();
		}
		
		public function nextNumber():Number
		{
			_seed = (_seed * 9301 + 49297) % 233280;
			return _seed / 233280.0;
		}
	}

}